package com.minio.system;

import io.minio.BucketExistsArgs;
import io.minio.MinioClient;
import io.minio.UploadObjectArgs;
import io.minio.errors.*;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

/**
 * @Author：万意佳
 * @Date:
 * @Description:
 **/
public class demo {
    public static void main(String[] args)throws IOException , NoSuchAlgorithmException, InvalidKeyException{
        try {
            MinioClient minioClient = MinioClient.builder().endpoint("").credentials("11","").build();

            boolean b = minioClient.bucketExists(BucketExistsArgs.builder().build());

            if(!b){
                minioClient.bucketExists(BucketExistsArgs.builder().build());
            }else {
                System.out.println("Bucket 'photo' already exists.");
            }

            minioClient.uploadObject(
                    UploadObjectArgs.builder()
                            .bucket("")
                            .object("")
                            .filename("")
                            .build());
        } catch (MinioException e) {

        }
    }
}
